<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="../WEB-INF/plantilla/layout.xhtml">
	<ui:define name="contenido">
		<h:form id="frmIngresoDiagnostico">
			<p:notificationBar  autoDisplay="#{hc.msj2 ne '' }"  position="top" effect="slide" styleClass="top" widgetVar="bar"  style="height:auto;opacity: 0.90; text-align: center;">
				<h:outputText value="Resultado:" style="font-size:16px;font-weight: bold;color: green; text-align: center;" /> <br></br>
				<h:outputText style="font-size:x-large;font-weight: bold;color: green; text-align: center;" value="#{hc.msj2}"  /> <br></br>
			    <p:commandButton value="Cerrar" onclick="PF('bar').hide()" type="button" icon="ui-icon-arrow-1-n"/>
			</p:notificationBar>
			
			<p:panel  id="pnl1" header="General Detalles">

				<h:panelGrid columns="15">

					<h:outputLabel for="txtApellido" value="Apellido Paterno:" />
					<p:inputText value="#{hc.apellidos}" maxlength="30"
						id="txtApellido" styleClass="tamanoCajaCabecera"
						required="true"  requiredMessage="(*)" >
					</p:inputText>
					<h:message for="txtApellido" />
					
					<p:spacer width="5px" />

					<h:outputLabel for="txtApellidoMaterno" value="Apellido Materno:" />
					<p:inputText value="#{hc.apellidoMaterno}" id="txtApellidoMaterno"
						styleClass="tamanoCajaCabecera" 
						required="true"  requiredMessage="(*)" >
					</p:inputText>
					<h:message for="txtApellidoMaterno"/>

					<p:spacer width="5px" />

					<h:outputLabel for="txtNombres" value="Nombres:" />
					<p:inputText value="#{hc.nombres}" id="txtNombres"
						styleClass="tamanoCajaCabecera"
						required="true"  requiredMessage="(*)" >
					</p:inputText>
					<h:message for="txtNombres"/>

					<p:spacer width="5px" />

					<h:outputLabel for="txtNumHistoria" value="HC:" />
					<p:inputText value="#{hc.numeroHistoria}" id="txtNumHistoria"
						styleClass="tamanoCajaCabecera" aling="right"
						required="true"  requiredMessage="(*)" >
					</p:inputText>
					<h:message for="txtNumHistoria"/>

				</h:panelGrid>

				<h:panelGrid columns="10">

					<h:outputLabel for="txtEstablecimientoSalud"
						value="Estable. de Salud:" />
					<p:inputText value="#{hc.establecimientoSalud}"
						id="txtEstablecimientoSalud" styleClass="tamanoCajaCabecera"></p:inputText>

					<p:spacer width="5" />

					<h:outputLabel for="txtFecha" value="Fecha:" />
					<p:calendar value="#{hc.fechaIngreso}" pattern="dd/mm/yyyy"
						id="txtFecha" styleClass="tamanoCajaCabecera" size="10"
						maxlength="10" showOn="button" />

					<p:spacer width="37" />

					<h:outputLabel value="¿TIENE SINDROME METABÓLICO?" rendered="false"/>

					<h:selectOneRadio id="rbtnIsSindromeMetabolico"
						value="#{hc.isSindromeMetabolico}" rendered="false">

						<f:selectItem itemLabel="Si" itemValue="1" />
						<f:selectItem itemLabel="No" itemValue="0" />

					</h:selectOneRadio>
					<p:message for="rbtnIsSindromeMetabolico" />

				</h:panelGrid>

			</p:panel>

			<p:wizard flowListener="#{hc.onFlowProcess}" >

				<p:tab id="paso1" title=" 1"  >
				
					<p:panel header="Detalles Paso 1">
					
					<h:panelGrid columns="3" width="100%">

						<p:fieldset legend="General" style="height:150px;" >

								<h:panelGrid columns="4" columnClasses="label, value"
									styleClass="grid">

									<h:outputText value="Edad: " />
									<p:inputText value="#{hc.edad}" id="txtEdad"
										styleClass="tamanoCajaSimple"></p:inputText>años
									<h:inputHidden value="#{hc.idEdad}" />

									<h:outputText value="Talla: " />
									<p:inputText value="#{hc.talla}" id="txtTalla"
										styleClass="tamanoCajaSimple"></p:inputText>cm.
									<h:inputHidden value="#{hc.idTalla}"></h:inputHidden>

									<h:outputText value="Peso: " />
									<p:inputText value="#{hc.peso}" id="txtPeso"
										styleClass="tamanoCajaSimple">
										<p:ajax event="keyup" listener="#{hc.calcularIMC}" process="txtTalla, txtPeso" update="txtImc" ></p:ajax>	
									</p:inputText>kg.
									<h:inputHidden value="#{hc.idPeso}"></h:inputHidden>

									<h:outputText value="Sexo: " />
									<p:inputText value="#{hc.sexo}" id="txtSexo"
										styleClass="tamanoCajaSimple"></p:inputText>F/M
									<h:inputHidden value="#{hc.idSexo}"></h:inputHidden>

								</h:panelGrid>

						</p:fieldset>


						<p:fieldset legend="Dislipidemia" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Trigliceridos: " />
								<p:inputText value="#{hc.trigliceridos}" id="txtTrigliceridos"
									styleClass="tamanoCajaSimple"></p:inputText>mg/dl.
								<h:inputHidden value="#{hc.idTrigliceridos}"></h:inputHidden>

								<h:outputText value="HDL: " />
								<p:inputText value="#{hc.hdl}" id="txtHdl"
									styleClass="tamanoCajaSimple"></p:inputText>mg/dl.
								<h:inputHidden value="#{hc.idHdl}"></h:inputHidden>

								<h:outputText value="Previo: " />
								<p:inputText value="#{hc.rpPrevio}" id="txtRpPrevio"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idRpPrevio}"></h:inputHidden>
								
							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="MicroAlbuminuria" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Microalbuminuria: " />
								<p:inputText value="#{hc.microalbuminuria}"
									id="txtMicroalbuminuria" styleClass="tamanoCajaSimple"></p:inputText>ug/minuto
								<h:inputHidden value="#{hc.idMicroalbuminuria}"></h:inputHidden>

								<h:outputText value="Albumina/Creatina: " />
								<p:inputText value="#{hc.albuminaCreatina}"
									id="txtAlbuminaCreatina" styleClass="tamanoCajaSimple"></p:inputText>mg/g.
								<h:inputHidden value="#{hc.idAlbuminaCreatina}"></h:inputHidden>

							</h:panelGrid>

						</p:fieldset>

					</h:panelGrid>
					
					</p:panel>

				</p:tab>

				<p:tab id="paso2" title=" 2">
					<p:panel header="Detalles Paso 2">
						
					<h:panelGrid columns="3" width="100%">

						<p:fieldset legend="Antecedentes Familiares" style="height:160px;">
							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Con DM2: " />
								<p:inputText value="#{hc.conDM2}" id="txtConDM2"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idConDM2}" />

								<h:outputText value="Con HTA: " />
								<p:inputText value="#{hc.conHTA}" id="txtConHTA"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idConHTA}"></h:inputHidden>

								<h:outputText value="Con ECV: " />
								<p:inputText value="#{hc.conECV}" id="txtConECV"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idConECV}"></h:inputHidden>

							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Otros Diag. Previos" style="height:165px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="ECV: " />
								<p:inputText value="#{hc.ecv}" id="txtEcv"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idEcv}" />

								<h:outputText value="HTA: " />
								<p:inputText value="#{hc.hta}" id="txtHta"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idHta}" />

								<h:outputText value="SOP: " />
								<p:inputText value="#{hc.sop}" id="txtSop"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idSop}" />

								<h:outputText value="A Nigricans: " />
								<p:inputText value="#{hc.aNigricans}" id="txtANigricans"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idANigricans}" />

								<h:outputText value="Higado Graso: " />
								<p:inputText value="#{hc.higadoGraso}" id="txtHigadoGraso"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idHigadoGraso}" />

							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Otros" style="height:165px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Sedentarismo: " />
								<p:inputText value="#{hc.sedentarismo}" id="txtSedentarismo"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idSedentarismo}" />

								<h:outputText value="> 40 años: " />
								<p:inputText value="#{hc.m40anos}" id="txtm40anos"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idM40anos}" />

							</h:panelGrid>

						</p:fieldset>

					</h:panelGrid>
						

					</p:panel>
				</p:tab>

				<p:tab id="paso3" title=" 3">
					<p:panel header="Detalles Paso 3">
					<h:panelGrid columns="3" width="100%">

						<p:fieldset legend="HTA" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Sistólica: " />
								<p:inputText value="#{hc.sistolica}" id="txtSistolica"
									styleClass="tamanoCajaSimple"></p:inputText>mm/Hg
								<h:inputHidden value="#{hc.idSistolica}"></h:inputHidden>

								<h:outputText value="Diastólica: " />
								<p:inputText value="#{hc.diastolica}" id="txtDiastolica"
									styleClass="tamanoCajaSimple"></p:inputText>mm/Hg
								<h:inputHidden value="#{hc.idDiastolica}"></h:inputHidden>

								<h:outputText value="Rp AntiHTA: " />
								<p:inputText value="#{hc.rpAntiHTA}" id="txtRpAntiHTA"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idRpAntiHTA}"></h:inputHidden>

							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Obesidad" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="IMC: " />
								<p:inputText value="#{hc.imc}" id="txtImc"
									styleClass="tamanoCajaSimple"></p:inputText>kg/m2
								<h:inputHidden value="#{hc.idImc}"></h:inputHidden>

								<h:outputText value="Perimetro Abdominal: " />
								<p:inputText value="#{hc.perimetroAbdominal}" id="txtPerimetroAbdominal"
									styleClass="tamanoCajaSimple"></p:inputText>cm.
								<h:inputHidden value="#{hc.idPerimetroAbdominal}"></h:inputHidden>

								
							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Glicemia" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Basal: " />
								<p:inputText value="#{hc.basal}" id="txtBasal"
									styleClass="tamanoCajaSimple"></p:inputText>mg/dl.
								<h:inputHidden value="#{hc.idBasal}" />

								<h:outputText value="PP: " />
								<p:inputText value="#{hc.pp}" id="txtPp"
									styleClass="tamanoCajaSimple"></p:inputText>mg/dl.
								<h:inputHidden value="#{hc.idPp}"></h:inputHidden>

								<h:outputText value="TTG: " />
								<h:panelGrid columns="12" id="tot">
								
									<p:inputText value="#{hc.ttg}" id="txtTtg"
										styleClass="tamanoCajaSimple"></p:inputText>
									<h:inputHidden value="#{hc.idTtg}"></h:inputHidden>
									
									<p:inputText value="#{hc.ttg0}" id="txtTtg0" styleClass="tamanoCajaSimple"></p:inputText>
									<h:inputHidden value="#{hc.idTtg0}"></h:inputHidden>
									
									<p:inputText value="#{hc.ttg30}" id="txtTtg30" styleClass="tamanoCajaSimple"></p:inputText>
									<h:inputHidden value="#{hc.idTtg30}"></h:inputHidden>
									
									<p:inputText value="#{hc.ttg60}" id="txtTtg60" styleClass="tamanoCajaSimple"></p:inputText>
									<h:inputHidden value="#{hc.idTtg60}"></h:inputHidden>
									
									<p:inputText value="#{hc.ttg90}" id="txtTtg90" styleClass="tamanoCajaSimple"></p:inputText>
									<h:inputHidden value="#{hc.idTtg90}"></h:inputHidden>
									
									<p:inputText value="#{hc.ttg120}" id="txtTtg120" styleClass="tamanoCajaSimple"></p:inputText>
									<h:inputHidden value="#{hc.idTtg120}"></h:inputHidden>
																
								</h:panelGrid>mg/dl.
								<p:message for="tot"></p:message>
								
								<h:outputText value="Hb A1 c: " />
								<p:inputText value="#{hc.hbA1c}" id="txtHbA1c"
									styleClass="tamanoCajaSimple"></p:inputText>%
								<h:inputHidden value="#{hc.idHbA1c}"></h:inputHidden>
																
							</h:panelGrid>

						</p:fieldset>

					</h:panelGrid>
						

					</p:panel>
				</p:tab>
				
					<p:tab id="paso4" title=" 4">
					<p:panel header="Detalles Paso 4">
					<h:panelGrid columns="3" width="100%">

						<p:fieldset legend="Resistencia Insulina" style="height:170px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="HOMA IR: " />
								<p:inputText value="#{hc.homaIr}" id="txtHomaIr"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idHomaIr}"></h:inputHidden>

								<h:outputText value="Insulina Basal: " />
								<p:inputText value="#{hc.insulinaBasal}" id="txtInsulinaBasal"
									styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idInsulinaBasal}"></h:inputHidden>

							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Diabetes" style="height:170px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="DM1: " />
								<p:inputText value="#{hc.dm1}" id="txtDm1" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idDm1}"></h:inputHidden>
						
								<h:outputText value="DM2: " />
								<p:inputText value="#{hc.dm2}" id="txtDm2" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idDm2}"></h:inputHidden>
								
								<h:outputText value="DMG: " />
								<p:inputText value="#{hc.dmg}" id="txtDmg" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idDmg}"></h:inputHidden>
								
								<h:outputText value="DMS: " />
								<p:inputText value="#{hc.dms}" id="txtDms" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idDms}"></h:inputHidden>
								
								<h:outputText value="PRE DM basal: " />
								<p:inputText value="#{hc.preDmBasal}" id="txtPREDmBasal" styleClass="tamanoCajaSimple"></p:inputText>
								
								<h:panelGrid columns="3">
									<h:inputHidden value="#{hc.idPreDmBasal}"></h:inputHidden>
								
									<h:selectOneRadio id="txtIsPreDmBasal" value="#{hc.isPreDmBasal}">
										<f:selectItem itemLabel="Si" itemValue="1" />
										<f:selectItem itemLabel="No" itemValue="0" />
									</h:selectOneRadio>
								
									<h:inputHidden value="#{hc.idIsPreDmBasal}"></h:inputHidden>
								
								</h:panelGrid>
								
								
							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Antecedentes Personales" style="height:170px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="DMG  Previa: " />
								<p:inputText value="#{hc.dmgPrevia}" id="txtDmgPrevia" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idDmgPrevia}"></h:inputHidden>
	
								<h:outputText value="AGA Previa: " />
								<p:inputText value="#{hc.agaPrevia}" id="txtAgaPrevia" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idAgaPrevia}"></h:inputHidden>

								<h:outputText value="ITG previa: " />
								<p:inputText value="#{hc.itgPrevia}" id="txtItgPrevia" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idItgPrevia}"></h:inputHidden>
									
								<h:outputText value="DM Previa: " />
								<p:inputText value="#{hc.dmPrevia}" id="txtDmPrevia" styleClass="tamanoCajaSimple"></p:inputText>SI/NO
								<h:inputHidden value="#{hc.idDmPrevia}"></h:inputHidden>
																
									
							</h:panelGrid>

						</p:fieldset>

					</h:panelGrid>
						

					</p:panel>
				</p:tab>
	
				<p:tab id="paso5" title=" 5">
					<p:panel header="Detalles Paso 5">
					<h:panelGrid columns="2" width="50%">
					
						<p:fieldset legend="Higado Graso" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="Higado Graso: " />
								<h:selectOneRadio id="rbtHigadoGraso" value="#{hc.isHigadoGraso}">
									<f:selectItem itemLabel="SI" itemValue="1" />
									<f:selectItem itemLabel="NO" itemValue="0" />
								</h:selectOneRadio>
								<p:message for="rbtHigadoGraso" />
								<h:inputHidden value="#{hc.idIsHigadoGraso}"></h:inputHidden>
																
									
							</h:panelGrid>

						</p:fieldset>

						<p:fieldset legend="Alt. Tiroidea" style="height:150px;">

							<h:panelGrid columns="4" columnClasses="label, value"
								styleClass="grid">

								<h:outputText value="T4L: " />
								<p:inputText value="#{hc.t4l}" id="txtT4l" styleClass="tamanoCajaSimple"></p:inputText>mU/L
								<h:inputHidden value="#{hc.idT4l}"></h:inputHidden>
								
								
								<h:outputText value="TSH: " />
								<p:inputText value="#{hc.tsh}" id="txtTsh" styleClass="tamanoCajaSimple"></p:inputText>mU/L
								<h:inputHidden value="#{hc.idTsh}"></h:inputHidden>
								
							</h:panelGrid>

						</p:fieldset>
											
						
					</h:panelGrid>
						
							<p:commandButton value="Guardar" onclick="cfdDiagnosticar.show();" ajax="true"></p:commandButton>
							
					</p:panel>
				</p:tab>

								
			</p:wizard>



			<p:confirmDialog id="cfdDiag" widgetVar="cfdDiagnosticar"
				message="¿Desea Diagnosticar el Paciente?" severity="alert"
				header="Mensaje de Informacion">

				<p:commandButton value="Si" ajax="false"
					actionListener="#{hc.diagnosticarAlIngresarPaciente}"
						onclick="cfdDiagnosticar.hide();"></p:commandButton>

				<p:commandButton value="No" ajax="false"
					actionListener="#{hc.grabarAlIngresarPaciente}" 
						onclick="cfdDiagnosticar.hide();"></p:commandButton>

				<p:commandButton value="Cancelar" ajax="true"
					onclick="cfdDiagnosticar.hide();"></p:commandButton>


			</p:confirmDialog>
	
	
		</h:form>

		
	</ui:define>
</ui:composition>

</html>
